n=eval(input())
list1=[]
for i in range(n):
    m=eval(input())
    list1.append(m)
maxshuzi=max(list1)
print(maxshuzi)
for j in range(len(list1)):
    if list1[j]==maxshuzi:
        print(j+1)
